<div class="page-header">
    <div class="icon">
        <span class="ico-layout-7"></span>
    </div>
    <h1>Clientes <small>Listado de usuarios</small></h1>
</div>
<div class="row-fluid">
    <div class="span12">
        <div class="block">
            <div class="head dblue">
                <div class="icon"><span class="ico-layout-9"></span></div>
                <h2>Tabla de Usuarios - Clientes</h2>
                <ul class="buttons">
                    <li><a href="#" onClick="source('table_sort_pagination');
                            return false;"><div class="icon"><span class="ico-info"></span></div></a></li>
                </ul>                                                        
            </div>                
            <div class="data-fluid">
                <table class="table fpTable lcnp" cellpadding="0" cellspacing="0" width="100%">
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>Solicitado</th>
                            <th>En caja</th>
                            <th>Fecha</th>
                            <th>Nombre</th>
                            <th>Usuario</th>
                            <th>Acciones</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach ($pedidos as $pe): ?>
                            <?php if ($pe['Pedido']['estado'] == 0): ?>
                                <tr>
                                    <td><?php echo $pe['Pedido']['id']; ?></td>
                                    <td><?php echo $pe['Pedido']['monto_solicitado']; ?></td>
                                    <td><?php echo $pe['User']['monto_tmp']; ?></td>
                                    <td><?php echo $pe['Pedido']['created']; ?></td>
                                    <td><?php echo $pe['User']['nombre']; ?></td>
                                    <td><?php echo $pe['User']['username']; ?></td>
                                    <td>                                                                                
                                        <a href="#bModal" role="button" data-toggle="modal" onclick="$('#contenidomodal').load('<?php echo $this->Html->url(array('action' => 'ajaxconfirma/' . $pe['Pedido']['id'])) ?>');" class="button green">
                                            <div class="icon"><span class="ico-ok"></span></div>
                                        </a>                                       
                                    </td>
                                </tr> 
                            <?php endif; ?>
                            <?php if ($pe['Pedido']['estado'] == 1): ?>
                                <tr >
                                    <td style="background: #DDFCDA;"><?php echo $pe['Pedido']['id']; ?></td>
                                    <td style="background: #DDFCDA;"><?php echo $pe['Pedido']['monto_solicitado']; ?></td>
                                    <td style="background: #DDFCDA;"> <?php echo $pe['User']['monto_tmp']; ?></td>
                                    <td style="background: #DDFCDA;"><?php echo $pe['Pedido']['created']; ?></td>
                                    <td style="background: #DDFCDA;"><?php echo $pe['User']['nombre']; ?></td>
                                    <td style="background: #DDFCDA;"><?php echo $pe['User']['username']; ?></td>
                                    <td style="background: #DDFCDA;"><b style="color: teal;">RECARGADO</b></td>
                                </tr> 
                            <?php endif; ?>
                        <?php endforeach; ?> 
                    </tbody>
                </table>                    
            </div> 
        </div> 
    </div>
</div>
  

